package com.avic.modules.system.rest;

import com.avic.modules.system.domain.WorkshopSection;
import com.avic.modules.system.service.mapper.WorkshopSectionMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhangzikang
 * @date 2022-08-14
 */
@Api(tags = "系统：用户工段")
@RestController
@RequestMapping("/api/workshop/paragraph")
public class WorkshopSectionController {

    private final WorkshopSectionMapper workshopSectionMapper;

    public WorkshopSectionController(WorkshopSectionMapper workshopSectionMapper) {
        this.workshopSectionMapper = workshopSectionMapper;
    }

    @ApiOperation("查询工段")
    @GetMapping
    public ResponseEntity<Object> getWorkshopSection() {
        QueryWrapper<WorkshopSection> criteria = new QueryWrapper<>();

        return new ResponseEntity<>(workshopSectionMapper.selectList(criteria), HttpStatus.OK);
    }
}
